class Solution:
    def addDigits(self, num: int) -> int:
        if num < 10:
            return num
        else:
            return self.addDigits(sum([int(i) for i in str(num)]))


if __name__ == "__main__":
    for i in range(1000):
        print(i, Solution().addDigits(i), i % 9)
